<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>商品分类管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <!--    <script rel="script" type="text/javascript" th:src="@{/js/jquery-3.5.1.min.js}"></script>-->
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}"  media="all">
    <script rel="script" type="text/javascript" th:src="@{/layui/layui.js}"></script>
    <script rel="script" type="text/javascript" th:src="@{/js/categoryManager.js}"></script>
    <script rel="script" type="text/javascript" th:src="@{/js/formVerify.js}"></script>
</head>
<body>
<script type="text/html" id="topTools">
    <button type="button" class="layui-btn layui-btn-normal" lay-event="createNewCategory">新增分类</button>
    <div class="layui-inline">
        <form class="layui-form layui-form-pane" lay-filter="categoryForm">
            <input id="searchCategoryName" name="searchCategoryName" type="text" class="layui-input-block" placeholder="请输入查询关键字" autocomplete="off"/>
            <input type="radio" title="父分类" value="1" name="itemType"  lay-filter="itemType">
            <input type="radio" title="子分类" value="2" name="itemType" lay-filter="itemType">
            <input type="radio" title="全部" value="" name="itemType" lay-filter="itemType">
            <div class="layui-btn-container layui-inline">
                <button type="button" class="layui-btn layui-btn-normal" lay-event="searchType">搜索</button>
            </div>
        </form>
    </div>


</script>
<!--<button id="disableRole" type="button" class="layui-btn" style="margin-left: 40% ; display: none" onclick="" >禁用角色</button>-->
<!--<button id="enableRole" type="button" class="layui-btn" style="margin-left: 40% ; display: none" onclick="" >启用角色</button>-->
<table class="layui-hide" id="categoryList" lay-filter="categoryList"></table>

<script type="text/html" id="categoryOperator">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    <a class="layui-btn  layui-btn-xs" lay-event="edit">编辑</a>
    {{# if(d.status == 0 && d.parentId != 0){ }}
        <a class="layui-btn layui-btn-xs"  lay-event="enable">启用</a>
        {{# }else if(d.status == 1 && d.parentId != 0){ }}
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="disable">禁用</a>
    {{# } }}
</script>





<div id="createCategory" class="layui-form" style="display: none">
    <form class="layui-form layui-form-pane" style="margin-left: 25%">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">分类名</label>
                <input type="text" name="name" class="layui-input" lay-verify="required" style="width: 50%"><br>
            </div><br>
            <div class="layui-inline">
                <label class="layui-form-label">分类类型</label>
                    <div class="layui-input-block" style="width: 50%">
                        <select id="categoryTypeSelect" lay-filter="categoryType"  class="select">
                            <option value="2">二级分类</option>
                        </select>
                    </div><br>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">父分类</label>
                    <div class="layui-input-block" style="width: 50%">
                        <select id="parentCategorySelect" lay-filter="parentCategory"  class="select">
                        </select>
                    </div><br>
            </div>
<!--            <div class="layui-inline">-->
<!--                <label class="layui-form-label">分类图片</label>-->
<!--                    <input type="file" name="catImage" class="layui-input " style="width: 50%"><br>-->
<!--            </div>-->
            <hr class="hr15">
            <div class="layui-inline">
                <button type="button" action="javascript:void(0)" lay-filter="creatCategory" lay-submit="" class="layui-btn" style="margin-left: 40%" onclick="createCategory()">新增分类</button>
            </div>
        </div>
    </form>
</div>
</body>
<script>



</script>
</html>